package bus.view;

import java.awt.Color;
import java.awt.Font;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.security.PublicKey;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;

public class Ticket  extends JFrame {
	public Print p1;
	public BookTickets p2;
	public JTabbedPane jtad;
	public CancelTicket p3;
	public UpdateContact p4;
	public String username;
	public Ticket(String username) throws Exception{
		this.username=username;
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jtad=new JTabbedPane(JTabbedPane.TOP);
		p1=new Print(username);
		p2=new BookTickets(username);
		p3=new CancelTicket(username);
		p4=new UpdateContact(username);
		jtad.add("Book Tickets", p2);
		jtad.add("Cancel Tickets", p3);
		
		jtad.add("Update information", p4);
		jtad.add("Print Ticket", p1);
		setIconImage(new ImageIcon(Ticket.class.getResource("/bus/resource/aa.jpg")).getImage());
		setTitle("My Trip Bus Servies. Welcome "+username);
		setBounds(100, 100, 900, 600);
		setVisible(true);
		add(jtad);
	}
}
